home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 019a / xe20.zip / XE.DOC next >
Text File  |  1991-09-25  |  22KB  |  492 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.                                ≡■≡  heXEdit  ≡■≡
  10.  
  11.  
  12.  
  13.                                   Version 2.0
  14.  
  15.                                     9-25-91
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.                                  Robert Stuntz
  25.                             1747 Crystal Lane   #610
  26.                             Mt. Prospect, IL.  60056
  27.  
  28.  
  29.                                 GEnie : R.STUNTZ
  30.  
  31.  
  32.  
  33.                                  DISCLAIMER
  34.  
  35.        THIS SOFTWARE AND MANUAL ARE DISTRIBUTED "AS IS" AND WITHOUT
  36.        WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER
  37.        WARRANTIES WHETHER EXPRESSED OR IMPLIED.  BECAUSE OF THE VARIOUS
  38.        HARDWARE AND SOFTWARE ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE
  39.        PUT, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED AND
  40.        ALL LIABILITY IN THE USE AND AFFECTS OF THIS PROGRAM SHALL REST
  41.        WITH THE USER.
  42.  
  43.  
  44.  
  45.  
  46.         ≡■≡ Introduction
  47.  
  48.  
  49.  
  50.                 heXEdit (XE) is a program that will allow you to
  51.         display and/or edit any file. It has few and simple commands
  52.         but serves my purposes perfectly. I wrote this program because
  53.         I became frustrated with a couple of other commercial programs.
  54.         They either had some annoying peculiarities or required too
  55.         much thought on my part just to search for and change a couple
  56.         of bytes.
  57.  
  58.                 heXEdit was written using Turbo Pascal v6.0, although
  59.         it doesn't use any of Borland's object libraries. It does
  60.         however write directly to the screen for speed when scrolling
  61.         thru the file. If you're using a CGA monitor you may see some
  62.         'snow' as I don't check for the vertical retrace period to
  63.         write to the screen.
  64.  
  65.                 When heXEdit starts it looks for a configuration file
  66.         that defines the colors to be used. The name of the file is
  67.         'XE.CFG'. XE first looks in the current directory for the file.
  68.         If it doesn't find it there it checks the environment for a
  69.         variable named 'XE' and looks in the path specified by that
  70.         variable. (See your DOS manual for an explanation of
  71.         environment variables). If XE doesn't find it there it then
  72.         looks in the directory that XE.EXE is in.
  73.  
  74.                 The environment variable 'XE' can be set by using the
  75.         DOS SET command. You should include the full path, just so
  76.         there is no confusion as to what drive the file is on. For
  77.         example :
  78.  
  79.                 SET XE=C:\UTIL\
  80.  
  81.         Also, the last back-quote character should be included as I
  82.         just append the filename to the path you specify. If you do
  83.         use an environment variable but XE can't find the file there,
  84.         it will look in the same directory that XE.EXE is in. If you
  85.         don't use the configuration file in the first place, XE will
  86.         use a default set of colors.
  87.  
  88.                 heXEdit will keep no more than 1760 bytes of the file
  89.         in memory at a time, as I didn't feel like messing with a
  90.         variable amount of memory available. heXEdit only requires
  91.         about 83k bytes of free memory in order to execute.
  92.  
  93.  
  94.  
  95.  
  96.         ≡■≡ Using heXEdit
  97.  
  98.  
  99.                 To start heXEdit, enter
  100.  
  101.                 XE [drive | filename]
  102.  
  103.  
  104.                 The drive designator and filename are optional on the
  105.         command line. If only a drive letter is specified XE will
  106.         change your current directory to that drive and show you the
  107.         files from the root directory of that drive. If a file is
  108.         specified XE will try to load that file, if not, the Loadfile
  109.         box will appear with a list of files in the current directory.
  110.         With the Loadfile box you can use the Up/Down arrow keys,
  111.         PgUp/PgDn and the Home/End keys to move the highlight bar to
  112.         the file you want to load.  The Up/Down arrow keys will move
  113.         the bar one file at a time.  PgUp/PgDn move the bar a page at a
  114.         time, and Home/End will move the bar to the beginning/end of
  115.         the list of files.
  116.  
  117.                 With the highlight bar over the file you want to load,
  118.         just hit <ENTER> to load the file. If there is an error trying
  119.         to load the file an error message will pop up giving you four
  120.         options.
  121.  
  122.         Option 1 - (A)bort : if you press 'A' XE will abort the
  123.         operation.
  124.  
  125.         Option 2 - (R)etry : press 'R' to retry the operation. (Maybe
  126.         the drive door was opened before you hit <ENTER> to load the
  127.         file.)
  128.  
  129.         Option 3 - (Q)uit XE : quit XE and return to the DOS prompt (or
  130.         wherever it was that you came from).
  131.  
  132.         Option 4 - Any other key : if you hit any other key than the
  133.         ones described above you will be returned to the Loadfile box.
  134.  
  135.                 While in the Loadfile box, hitting <ESC> will exit the
  136.         Loadfile box and either 1) return you to the last file you were
  137.         editing, or if no file was previously loaded 2) exit XE altogether.
  138.  
  139.                 One last feature of the Loadfile box is that you can change
  140.         the attributes of a file simply by hitting F5-F8 (providing the
  141.         file is available; i.e., the disk is in the drive etc.) Move
  142.         the highlight bar to file you want to work with and then simply
  143.         hit one of the following, depending on what you want to do.
  144.  
  145.                 F5 - toggles the Archive bit
  146.                 F6 - toggles the System bit
  147.                 F7 - toggles the Hidden bit
  148.                 F8 - toggles the Read_Only bit
  149.  
  150.         If the attribute change was successful you will hear a high
  151.         pitch tone otherwise you will hear a lower tone indicating that
  152.         the attribute could not be changed for one reason or another.
  153.  
  154.                 Once the file is loaded you will see the main display.
  155.         At the top is the name of the file loaded. On the left side of the
  156.         display are numbers (in hexadecimal,decimal or octal)
  157.         indicating the offset into the file. In the middle are 22 rows
  158.         of 16 bytes each which are the file's contents. On the right,
  159.         the ASCII character for each byte in that row. In the ASCII
  160.         portion of the display, any characters past the EOF are shown
  161.         as a '.' (#249). On the bottom is a status word indicating your
  162.         current operation, the size of the file in decimal, and whether
  163.         the offset display is in 'hex'adecimal, 'dec'imal, or 'oct'al.
  164.  
  165.  
  166.  
  167.  
  168.         ≡■≡ Commands
  169.  
  170.  
  171.  
  172.         Following is a list of commands once you are in XE and then a
  173.         brief explanation of each :
  174.  
  175.  
  176.         F1- Help
  177.         A - ASCII table
  178.         E - Edit the file
  179.         S - Search (for text or a byte string)
  180.         N - Search again (using the last used search string)
  181.         L - Load a new file
  182.         C - Change colors (and/or save a configuration file for colors)
  183.         B - Base conversion (decimal-hexadecimal-binary)
  184.         D - Change offset display to Decimal
  185.         H - Change offset display to Hexadecimal
  186.         O - Change offset display to Octal
  187.         G - Goto offset
  188.         M - Push position on marker stack
  189.         R - Retrieve position from marker stack
  190.         Z - Clear all entries from marker stack
  191.  
  192.         Up/Down arrow keys - scroll up and down one line at a time
  193.         PgDn/PgUp          - move up/down one page at a time
  194.         Home               - move the beginning of the file
  195.         End                - move to the end of the file
  196.         ESC/Alt-X          - quit XE
  197.  
  198.  
  199.  
  200.  
  201.  
  202.         ■-- F1: Display a simple help screen of commands. Hit any key
  203.                to exit the help screen.
  204.  
  205.  
  206.         ■-- A : This displays an ASCII chart.
  207.  
  208.                ASCII chart commands :
  209.                - Left arrow key  : go back 16 characters
  210.                - Right arrow key : go forward 16 characters
  211.                - PageUp          : go back 128 characters
  212.                - PageDown        : go forward 128 characters
  213.                - D               : display numbers in decimal
  214.                - H               : display numbers in hexadecimal
  215.                - ESC or Enter    : exits ASCII chart
  216.  
  217.  
  218.         ■-- E : Begin editing the file at the current position.
  219.  
  220.                 Edit commands :
  221.                 - BackSpace/Left arrow key  : move cursor left 1 byte
  222.                 - Right arrow key : move cursor right 1 byte
  223.                 - PageUp          : move cursor to first byte on page
  224.                 - PageDown        : move cursor to last byte on page
  225.                 - Home            : move cursor to beginning of line
  226.                 - End             : move cursor to end of line
  227.                 - TAB             : toggle cursor position between the
  228.                        hexadecimal display and the ASCII display of the
  229.                        file. The above editing commands will move the
  230.                        cursor within the area the cursor is in.
  231.                        You can edit the file making changes in both
  232.                        areas at the same time, if so desired.
  233.                 - ESC/Enter       : quit editing. If you made changes
  234.                        you will be prompted to save the changes or not.
  235.                        Hit 'Y' to save the changes or 'N' to lose the
  236.                        changes. Only the portion of the file that is in
  237.                        memory is actually saved. So don't worry about
  238.                        waiting for a long save if you are editing a
  239.                        large file. You are then returned to the View
  240.                        mode.
  241.  
  242.                 To change a value when in the hexadecimal portion, just
  243.                 type in it's new value. The background of the character
  244.                 will change, indicating which bytes have been changed.
  245.                 Valid values are '00' - 'FF'. Obviously, hitting a key
  246.                 like 'P' will do nothing because 'P' is not a valid
  247.                 hexadecimal character. A special note, once you change
  248.                 the left half of the byte, you must continue and change
  249.                 the right half also.
  250.  
  251.                 To change a value when in the ASCII portion of the
  252.                 display, simply hit the key of the new value. Again,
  253.                 the background will change indicating a change.
  254.  
  255.                 Note - When in edit mode you will be able to change the
  256.                 characters after the EOF. It will look like you are
  257.                 changing the file but in reality nothing will be
  258.                 changed. You cannot increase the size of the file,
  259.                 only change what already exists.  (A small price
  260.                 to pay for making the coding easier on me!)
  261.  
  262.  
  263.         ■-- S : Search the file for a byte or text sequence.
  264.  
  265.                 You will be prompted for the type of search 1) Byte or
  266.                 2) Text.
  267.  
  268.                 For a byte sequence, enter the bytes then hit Enter. As
  269.                 with editing, you must enter a complete byte, although
  270.                 I don't check for that here. You can use the backspace
  271.                 key to go back and make corrections. The maximum length
  272.                 for a byte sequence is 9 bytes. I think that is plenty
  273.                 long enough, even 4 bytes would probably be enough to
  274.                 find what you're looking for.
  275.  
  276.                 For a text sequence, just type in the text to search
  277.                 for, no quotes are needed, and hit Enter. The maximum
  278.                 length for a text sequence is 25 characters. And a
  279.                 change from my earlier versions, the search is now case
  280.                 insensitive.
  281.  
  282.                 If the search string is found, the display will move to
  283.                 that string's location in the file and will be high-
  284.                 lighted at the top of the screen. You can now hit any
  285.                 key to continue the search, hit 'M' to Mark the
  286.                 position or hit ESC to stop searching.
  287.  
  288.                 Just to make things simple for myself, every search
  289.                 starts at the beginning of the file. Even on large
  290.                 files, starting at the beginning to find something you
  291.                 know is near the end doesn't take very long at all (at
  292.                 least not on my 16 Mhz 386sx!)
  293.  
  294.  
  295.         ■-- N : Search again using the last used search string. If
  296.                 there is no previous search string, you will be
  297.                 prompted, as if you hit 'S', to enter a search string.
  298.  
  299.  
  300.         ■-- L : Load a new file. You will enter the Loadfile box in
  301.                 order to select a new file (as described earlier in
  302.                 this document under   ≡■≡ Using heXEdit).
  303.  
  304.                 Since you can't leave the edit mode without either
  305.                 saving any changes or losing changes, you needn't worry
  306.                 about saving the current file before loading a new one.
  307.  
  308.  
  309.         ■-- C : This command will allow you to change the color of just
  310.                 about anything. Of course, if you're using a monochrome
  311.                 monitor this command will do nothing. You can also save
  312.                 a color configuration file if you like, so that XE will
  313.                 startup with the colors you like.
  314.  
  315.                 I didn't do anything fancy here. Simply select the area
  316.                 you want to change the color in by hitting a letter 'A'
  317.                 thru 'W' (with the exception of 'S'). Then enter the
  318.                 number corresponding to the color you want.
  319.  
  320.                 Color change commands:
  321.                 ■- A - W  : select the area you want to change (except 'S')
  322.                 ■- ESC/Enter : exit the color change screen
  323.                 ■- S  : save a configuration file with the currently
  324.                         selected colors
  325.  
  326.                         This command will save a file named 'XE.CFG'
  327.                         that defines the colors for XE to use. The file
  328.                         is saved in the same place it was found. If
  329.                         this is the first time this file has existed,
  330.                         it will be saved in the current directory.
  331.  
  332.  
  333.         ■-- B : Convert a number from either decimal, hexadecimal or
  334.                 binary to the other two.
  335.  
  336.                 Base convert commands :
  337.                 ■- Up/Down arrow keys : select the base of the input
  338.                                         number
  339.                 ■- Enter              : convert the number
  340.                 ■- ESC                : exit the base convert routine
  341.  
  342.                 Using the arrow keys, move the highlight bar to the
  343.                 base of the input number and then either 1) hit Enter
  344.                 and enter the number or 2) just start typing the
  345.                 number. After the number has been converted, hit any
  346.                 key to select the base for another conversion or hit
  347.                 ESC to exit.
  348.  
  349.                 When you enter the number, I only check for validity
  350.                 with the first character. If you try to convert an
  351.                 invalid number an error message will be displayed. The
  352.                 largest number that can be accurately converted is a 32
  353.                 bit number. It has a very simple input routine, so
  354.                 don't be surprised if you can enter an invalid number.
  355.                 The conversion will be incorrect of course. I leave
  356.                 it mostly up to you to enter a valid number.
  357.  
  358.  
  359.         ■-- D : Change the offset display to base 10, decimal.
  360.  
  361.  
  362.         ■-- H : Change the offset display to base 16, hexadecimal.
  363.  
  364.  
  365.         ■-- O : Change the offset display to base 8, octal.
  366.  
  367.  
  368.         ■-- G : Goto an offset in the file.
  369.  
  370.                 You are prompted for an offset to go to. You can enter
  371.                 either a decimal number or a hexadecimal number. If you
  372.                 hit ESC while entering a number you will be placed back
  373.                 in the View mode with no repositioning taking place.
  374.                 The BACKSPACE key can be used to edit your entry. If
  375.                 you enter an offset that is beyond the End-Of-File
  376.                 (or < 0) you will be prompted again for a number.
  377.  
  378.                 To enter a decimal number just type in the number, no
  379.                 commas, and hit ENTER.
  380.  
  381.                 To enter a hexadecimal number, type a '$' as the first
  382.                 character and then continue entering the hex number.
  383.  
  384.                 Also, if at anytime while entering a number, you enter
  385.                 an 'A' through 'F' a '$' will be inserted into your
  386.                 number at the beginning and your entry will be taken as
  387.                 a hexadecimal number. For example:
  388.  
  389.                         Keystroke               Screen
  390.                         3                       3
  391.                         5                       35
  392.                         1                       351
  393.                         E                       $351E
  394.                         etc ...
  395.  
  396.  
  397.         ■-- M : Push position on marker stack.
  398.  
  399.                 Your current position in the file can be saved with
  400.                 this command and then be retrieved later on.
  401.  
  402.                 Your position is saved on a stack. If the stack is full
  403.                 the oldest position will be deleted and the rest of the
  404.                 entries will move down the stack to make room for the
  405.                 new entry. The maximum number of positions you can save
  406.                 is 100. Also, when your position is saved, it's location
  407.                 on the stack is reported to you so you can see how full
  408.                 the marker stack is.
  409.  
  410.                 This command can also be used while searching. If the
  411.                 search string is found, you can hit 'M' to save that
  412.                 position on the marker stack and then continue searching.
  413.  
  414.  
  415.         ■-- R : Goto position using the top marker stack entry.
  416.  
  417.                 While viewing the file, if you hit this command you
  418.                 will be moved to the location specified by the top
  419.                 marker stack entry. Once you have been moved to the new
  420.                 location, the entry you retrieved will be deleted
  421.                 from the marker stack. If there are no markers on the
  422.                 stack, then nothing will happen.
  423.  
  424.         ■-- Z : Clear all entries from marker stack
  425.  
  426.                 This command will delete all entries from the marker
  427.                 stack. Careful, there is no turning back from the
  428.                 results of this command.
  429.  
  430.  
  431.         ≡■≡ Comments
  432.  
  433.  
  434.         I would strongly suggest that you make a backup copy of the
  435.         file you're going to modify, just in case you decide later
  436.         you want the original file back. You should have a backup copy
  437.         anyway as a matter of safeguarding your files in case of
  438.         catastrophe.
  439.  
  440.         I have a 16Mhz 386sx AT running MS-DOS 5.0. XE should work
  441.         with most system configurations though. It does not support
  442.         any video modes other than 80x25 text and will work with a
  443.         monochrome monitor.
  444.  
  445.         Also, I don't expect any payment for use of this program. Feel
  446.         FREE to use it how you like, but be careful.
  447.  
  448.         I would like to hear any comments or complaints you might
  449.         have about this program. I can be reached on GEnie under
  450.         R.STUNTZ, or on The Chicago Megaphile BBS (312 283-4035) under
  451.         ROB STUNTZ. Or if you prefer, the good ole' U.S. Postal
  452.         Service.
  453.  
  454.  
  455.         Rob
  456.  
  457.  
  458.  
  459.         ≡■≡ Version History
  460.  
  461.             v1.0  4-8-91  - Initial writing
  462.             v1.1  5-16-91 - Minor internal changes
  463.             v1.2  7-4-91  - added Marker commands
  464.             v1.21 8-3-91  - increased marker stack size to 100
  465.                             added Z command; clear marker stack
  466.             v1.3  8-12-91 - added Goto Offset command
  467.                             fixed a bug or two
  468.             v2.0  9-25-91 - added Loadfile box (instead of typing in
  469.                               the filename)
  470.                             set to video page 0 at startup
  471.                               (this was done in case you shell out from
  472.                               another program and that program puts you
  473.                               in a video page other than 0, like Turbo
  474.                               Debugger. XE needs to be in video page
  475.                               0.  XE returns to the video page you
  476.                               where at before it started when you exit)
  477.                             added backspace key use while editing (acts
  478.                               like left arrow key)
  479.                             added 'D', 'H' and 'O' commands while viewing
  480.                             changed Help command to 'F1' from 'H'
  481.                             made Search command case insensitive
  482.                             added ability to enter a drive designator
  483.                               on cmd line to start Loadfile box on that drive
  484.                             and of course fixed some bugs ...
  485.  
  486.  
  487.         ≡■≡
  488.  
  489.         'Turbo Pascal' and 'Turbo Debugger' are registered trademarks
  490.         of Borland International, Inc.
  491.  
  492.